package com.zyx.shiro.controller;

import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 订单接口
 *
 * @author zyx
 * @since 2023/9/10 07:41
 */
@Slf4j
@Controller
@RequestMapping("order")
public class OrderController {

    /**
     * RequiresRoles(value={"admin","user"}) 用来判断角色 同时具有 admin user
     * RequiresPermissions("user:update:01") 用来判断权限字符串
     */
    @RequiresRoles(value = {"admin", "user"})
    @RequiresPermissions("user:update:01")
    @RequestMapping("save")
    public String save() {
        log.info("OrderController.save");
        return "redirect:/index.jsp";
    }

}
